{% extends "admin/base_site.html" %}
{% load i18n admin_modify adminmedia %}

{% block extrahead %}{{ block.super }}
<script type="text/javascript" src="../../../jsi18n/"></script>


<script type="text/javascript" src="{% admin_media_prefix %}jquery-ui.js"></script>
<!-- link rel="stylesheet" href="http://dev.jquery.com/view/tags/ui/latest/themes/flora/flora.all.css" type="text/css" media="screen" title="Flora (Default)" -->

<!--<script type="text/javascript" >
$(function () {
	$('#inline-tabs > ul').tabs();
});
</script>-->


{{ media }}
{% block myjs %}
{% endblock %}

{% endblock %}
{% block stylesheet %}{% admin_media_prefix %}css/forms.css{% endblock %}

{% block coltype %}{% if ordered_objects %}colMS{% else %}colM{% endif %}{% endblock %}

{% block bodyclass %}{{ opts.app_label }}-{{ opts.object_name.lower }} change-form{% endblock %}


{% block breadcrumbs %}{% if not is_popup %}
<div class="breadcrumbs">
     <a href="/admin/">{% trans "Home" %}</a> &rsaquo;
     <a href="/admin/{{ opts.app_label }}/{{ opts.object_name.lower }}/">{{ opts.verbose_name_plural|capfirst }}</a> &rsaquo;
     {% if add %}{% trans "Add" %} {{ opts.verbose_name }}{% else %}
     <a href="../">{{ original|truncatewords:"18" }}</a> &rsaquo;
     Editar
     
     {% endif %}
</div>
{% endif %}{% endblock %}

{% block content %}<div id="content-main">
{% block object-tools %}
{% if not is_popup %}
  <ul class="object-tools">
{% if change %}
  <li><a href="../history/" class="historylink">{% trans "History" %}</a></li>
  {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="viewsitelink">{% trans "View on site" %}</a></li>{% endif%}
  {% endif %}
  <li><a href="../" class="backlink">Volver</a></li>
  </ul>
{% endif %}
{% endblock %}
<form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% block form_top %}{% endblock %}
<div>
{% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %}
{% if save_on_top %}{% submit_row %}{% endif %}
{% if adminform.form.errors %}
    <p class="errornote">
    {% blocktrans count adminform.form.errors.items|length as counter %}Please correct the error below.{% plural %}Please correct the errors below.{% endblocktrans %}
    </p>
{% endif %}

{% for fieldset in adminform %}
  {% include "admin/includes/fieldset.html" %}
{% endfor %}

{% block after_field_sets %}{% endblock %}

{% for inline_admin_formset in inline_admin_formsets %}
    {% include inline_admin_formset.opts.template %}
{% endfor %}


{% block after_related_objects %}{% endblock %}

{% submit_row %}

{% if add %}
   <script type="text/javascript">//$(':input')[3].focus();</script>
{% endif %}

{# JavaScript for prepopulated fields #}

{% if add %}
<script type="text/javascript">
{% for field in adminform.prepopulated_fields %}
    document.getElementById("{{ field.field.auto_id }}").onchange = function() { this._changed = true; };
    {% for dependency in field.dependencies %}
    document.getElementById("{{ dependency.auto_id }}").onkeyup = function() {
        var e = document.getElementById("{{ field.field.auto_id }}");
        if (!e._changed) { e.value = URLify({% for innerdep in field.dependencies %}document.getElementById("{{ innerdep.auto_id }}").value{% if not forloop.last %} + ' ' + {% endif %}{% endfor %}, {{ field.field.field.max_length }}); }
    }
    {% endfor %}
{% endfor %}
</script>
{% endif %}

</div>
</form></div>
{% endblock %}
